Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Embedding Controls /


GetIndexedSubControl

NEW WITH THE APPEARANCE MANAGER

Returns a handle to a specified embedded control.

pascal OSErr GetIndexedSubControl (
                     ControlHandle inControl,
                     SInt16 inIndex,
                     ControlHandle* outSubControl);
inControl
On input, a handle to an embedder control.
inIndex
On input, a 1-based index--an integer between 1 and the value returned in the outNumChildren parameter of CountSubControls--indicating the specific control you wish to access.
outSubControl
On output, a pointer to a handle to the embedded control.
function result
A result code; see "Result Codes". The result code errControlIsNotEmbedder indicates that the embedder control does not support embedding or that embedding is not enabled for that window. If the index passed in is invalid, the paramErr result code is returned.
DISCUSSION
The GetIndexedSubControl function is useful for iterating over the control hierarchy. Also, the value of a radio group control is the index of its currently selected embedded radio button control. So, passing the current value of a radio group control into GetIndexedSubControl will give you a handle to the currently selected radio button control.

SEE ALSO
"Embedding Controls".

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998